import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'
import Vuex from 'vuex'
import store from './store'
import router from './router/index.js'
import Video from 'video.js'
import 'video.js/dist/video-js.css'
import qs from 'qs'
import axios from 'axios'
import VueCookies from 'vue-cookies'
import VueVideoPlayer from 'vue-video-player'
import VueI18n from 'vue-i18n'

import zhHans from './assets/lang/zhHans'
import en from './assets/lang/en'
import ja from './assets/lang/ja'
import 'video.js/dist/video-js.css'
import snowflake from './assets/snowflakes.min.js'
import VueWechatTitle from 'vue-wechat-title'
import VueCropper from 'vue-cropper'

Vue.use(VueCropper);
// import 'vue-video-player/src/custom-theme.css'
Vue.use(VueI18n);
const i18n = new VueI18n({
    locale: 'zhHans',
    messages: {
        'zhHans': zhHans,
        'en': en,
        'ja': ja
    }
});
Vue.use(VueVideoPlayer,
    /* {
  options: global default options,
  events: global videojs events
} */
)
Vue.use(VueCookies)
Vue.use(VueWechatTitle)
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
Vue.prototype.$axios = axios;
Vue.prototype.$qs = qs;

Vue.prototype.$video = Video
Vue.config.productionTip = false

router.beforeEach((to, from, next) => {
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
        document.title = to.meta.title;
    }
    next()
});

new Vue({
    store,
    vuetify,
    router,
    i18n,
    snowflake,
    beforeCreate() {
        // var sf = new snowflake({
        //   color: "#000000",
        //   count: 75,
        //   minOpacity: 0.2,
        //   maxOpacity: 0.6
        // });
    },

    render: h => h(App)
}).$mount('#app')